//
//  UIViewController+QDLogin.m
//  QDMetroClient
//
//  Created by YueWen on 2019/2/27.
//  Copyright © 2019 YueWen. All rights reserved.
//

#import "UIViewController+QDLogin.h"
#import "QDMetroClient-Swift.h"

@implementation UIViewController (QDLogin)


- (void)checkLogin:(void (^)(void))complete {
    
    //如果已经登录,直接执行
    if (QDUserStatus.isLogin) {
        complete(); return;
    }
    
    //没有登陆进行登录
    [self presentViewController:({
        [[HBDNavigationController alloc] initWithRootViewController:({
            
            QDLoginViewController *loginViewController = QDLoginViewController.new;
            loginViewController.loginComplete = complete;
            
            loginViewController;
            
        })];
        
    }) animated:true completion:nil];
}

@end
